<?=$system_message;?>
<?=form_open('');?>
<div class="section-container auto" data-section data-options="deep_linking: true">
  <section class="active">
    <p class="title" data-section-title><a href="#create-login">Add Student To Parent Login</a></p>
    <div class="content" data-slug="create-login" data-section-content>
    	<span class="clearfix"></span>

			<div class="panel">
				<div class="row">
					<div class="large-6 columns">
						<label>
							<i class="fa fa-user"></i>&nbsp; User Login
						</label>
						<code><?=$parent->login_name?></code>
					</div>
				</div>
				<hr>
				<div class="row">
					<div class="large-12 columns">
						<label>
							<i class="fa fa-users"></i>&nbsp; Children(s)
						</label>
						<?if($parent->children):?>
							<?foreach ($parent->children as $k => $c): ?>
								<? $c = (object)$c; ?>
								<menu>
									<i class="fa fa-hand-o-right"></i>&nbsp; <?=$c->fullname?>
									<a href="<?=site_url('user/delete_student_from_parent_login/'.__link($c->pc_id));?>" class="ajax-click btn btn-mini btn-danger" data-delete-container="menu" title="Are you sure you want to delete student from parent login?"><i class="fa fa-trash-o"></i>&nbsp;</a>
								</menu>
							<?endforeach;?>
						<?else:?>
							<br>
							<p>&nbsp; &nbsp; &nbsp; &nbsp; No children assigned.</p>
						<?endif;?>
					</div>
				</div>
			</div>

			<hr class="clearfix">

			<div class="panel">
				<div class="row">
					<div class="large-12 columns">
						<label>Search for student.</label>
						<input id="get_students" autocomplete="off" placeholder="To search student, enter student name or ID number." url="<?=site_url('output/get_students_for_parent_login/'.$user_id);?>" type="text" title="Please use this fields to search for parent's children.">
					</div>
				</div>
				<div class="row">
					<div class="large-12 columns">
					<?=form_error('children[]');?>
					<table id="student-results" class="table table-bordered table-stripped">
						<tbody>
							<tr class="info">
								<td colspan="2">Please search a student.</td>
							</tr>
						</tbody>
					</table>
					</div>
				</div>
				</div>
			<input type="hidden" name="form_token" value="<?=$form_token?>">
			<input type="submit" value="Update Parent Login" name="update_parent_login" class="btn btn-primary">
			<a href="<?=site_url('user/parentlogin#parent-login')?>" class="btn btn-default">Cancel</a>
    </div>
  </section>
</div>
</form>

<script type="text/javascript" src="<?=script_url('custom/createlogin');?>"></script>
<script type="text/javascript" src="<?=script_url('custom/ajaxclick');?>"></script>